<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<sx:head/>
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css"/>
<link href="<%=path%>/css/buttons.css" rel="stylesheet" type="text/css"/>
<link href="<%=path%>/css/flexslider.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<sx:div id="list">
<s:iterator value="pageObj.results" var="f">
	<div class="orders" onclick="javascript:window.location='<%=path %>/foodlist!detail?id=${f.id}';">
		<li class="ordersLeft"><img src="<%=path %>/images/food/${f.pic}" alt="餐品图片" /></li>
		<li class="ordersRight">
			<p class="title">${f.name }</p>
			<p class="fenlei">
			${f.foodType.name }
			</p>
			<p class="jiage">￥${f.price }元</p>
		</li>
	</div>
	<div class="decoration"></div>
</s:iterator>
	
<div class="pagination">
<s:form action="/foodlist!caidan" namespace="/web" id="frmPage">
<s:textfield name="pageObj.currPage" size="2"/>/${pageObj.allPages }页，每页显示${pageObj.rows }行，共${pageObj.allRows }行
<sx:a targets="list" formId="frmPage">GO!</sx:a>

<sx:a targets="list" formId="frmPage2">&laquo; 首页</sx:a>

<s:if test="pageObj.hasPrePage">
<sx:a targets="list" formId="frmPage3">&laquo; 上一页</sx:a>
</s:if>

<s:if test="pageObj.hasNextPage">
<sx:a targets="list" formId="frmPage4">下一页 &raquo; </sx:a>
</s:if>

<sx:a targets="list" formId="frmPage5">尾页 &raquo;</sx:a>
</s:form>
</div>

<s:form action="/foodlist!caidan" namespace="/web" id="frmPage2">
	<s:hidden name="pageObj.currPage" value="1"></s:hidden>
</s:form>
<s:form action="/foodlist!caidan" namespace="/web" id="frmPage3">
	<s:hidden name="pageObj.currPage" value="%{pageObj.prePage}"></s:hidden>
</s:form>
<s:form action="/foodlist!caidan" namespace="/web" id="frmPage4">
	<s:hidden name="pageObj.currPage" value="%{pageObj.nextPage}"></s:hidden>
</s:form>
<s:form action="/foodlist!caidan" namespace="/web" id="frmPage5">
	<s:hidden name="pageObj.currPage" value="%{pageObj.allPages}"></s:hidden>
</s:form>
<br/><br/><br/><br/>
</sx:div>

</body>
</html>
